
package adoc;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
 *
 * @author ILikePancakes
 */
public class AdocFile {
    public List<String> errors;
    public String mainDocumentPath;
    public List<String> appendices;
    public List<String> attachments;
    public Map<String, List> appendixMap;
    public List<String> unsignedMetadata;
    public List<String> signedMetadata;
    public String relations;
    public String manifest;
    public String extractedPath;

    public AdocFile(List<String> errors) { this.errors = errors; }

    public AdocFile(String extractedPath, List<String> errors) { this.extractedPath = extractedPath; this.errors = errors; }

    public AdocFile(String extractedPath, String mainDocumentPath, List<String> appendices, List<String> attachments, Map<String, List> appendixMap, List<String> unsignedMetadata,
            List<String> signedMetadata, String relations, String manifest) {
        this.extractedPath = extractedPath;
        this.mainDocumentPath = mainDocumentPath;
        this.appendices = appendices;
        this.attachments = attachments;
        this.appendixMap = appendixMap;
        this.unsignedMetadata = unsignedMetadata;
        this.signedMetadata = signedMetadata;
        this.relations = relations;
        this.manifest = manifest;
    }

    @Override
    protected void finalize() throws Throwable {
        super.finalize();
        if (extractedPath != null) AdocUtilities.deleteFile(new File(extractedPath));
    }
}
